package com.idp.demo.controller;

import com.idp.common.base.BaseController;
import com.idp.common.model.ResultModel;
import com.idp.demo.dto.GoodsDto;
import com.idp.demo.service.GoodsOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags="商品订单")
@RestController
@RequestMapping("/goodsOrder/")
public class GoodsOrderController extends BaseController {

	@Autowired
	private GoodsOrderService goodsOrderService;

	@ApiOperation(value="下单")
	@PostMapping("createOrder")
	public ResultModel createOrder(@RequestBody GoodsDto goodsDto) {
		goodsOrderService.createOrder(goodsDto);
		return ResultModel.success("下单成功", null);
	}

}
